package com.turing.data.model.domain.element;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description
 * @Author lcy
 * @Date 2021-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Builder(toBuilder = true)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class Template extends Model<Template> {

    @TableId(value = "template_sn", type = IdType.ASSIGN_UUID)
    private String templateSn;

    @TableField("template_name")
    private String templateName;

    @TableField("template_group")
    private Integer templateGroup;

    @TableField("privilege")
    private Integer privilege;

    @ApiModelProperty(value = "0内置 其它为内置模板id")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "是否自动审核,默认0为手动审核")
    @TableField("auto_audit")
    private Integer autoAudit;

    @ApiModelProperty(value = "逻辑删除0未删除 1已删除")
    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @ApiModelProperty(value = "创建人登录账号")
    @TableField("created_by")
    private String createdBy;

    @ApiModelProperty(value = "创建人用户名")
    @TableField("created_by_name")
    private String createdByName;

    @ApiModelProperty(value = "创建时间")
    @TableField("created_time")
    private Date createdTime;

    @ApiModelProperty(value = "最后更新人账号")
    @TableField("updated_by")
    private String updatedBy;

    @ApiModelProperty(value = "最后更新时间")
    @TableField("updated_time")
    private Date updatedTime;

    @ApiModelProperty(value = "需要引入json文件 0不需要 1需要")
    @TableField("needs_json")
    private Integer needsJson;

    @TableField("industry")
    private String industry;

    @TableField("background_url")
    private String backgroundUrl;

    @TableField("published")
    private Integer published;

    /**
     * 0为要素抽取场景   1为ocr场景
     */
    private Integer templateKind;

    @Override
    protected Serializable pkVal() {
        return this.templateSn;
    }
}

